package com.teamspyder.scouting;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
//import android.widget.ListAdapter;
import android.widget.ListView;

public class MainMenu extends ListActivity
{
	String classes[] = {"spyderScouting", "Splash", "MainMenu", "example3"};
	String classNames[] = {"Counter Demo", "Splash Screen", "Main Menu Callback", "Unused"};
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		try{
		Class ourClass = Class.forName("com.teamspyder.scouting."+classes[position]);
		Intent intendedTarget = new Intent(MainMenu.this,ourClass);
		startActivity(intendedTarget);
		}catch (ClassNotFoundException e){
			e.printStackTrace();
		}
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setListAdapter(new ArrayAdapter<String>(MainMenu.this, android.R.layout.simple_list_item_1, classNames));
	}
}